package ReefStats::Schema::DataTypes;

use warnings;
use strict;
use Exporter qw(import);

our @_unsigned       = ( unsigned          => 1 );
our @_int            = ( data_type         => 'int' );
our @_mediumint      = ( data_type         => 'mediumint' );
our @_smallint       = ( data_type         => 'smallint' );
our @_not_null       = ( is_nullable       => 0 );
our @_nullable       = ( is_nullable       => 1 );
our @_autoincrement  = ( is_auto_increment => 1 );
our @_dont_cascade   = ( cascade_delete    => 0 );
our @_default_nodate = ( default           => '0000-00-00 00:00:00' );
our @_int_10         = ( data_type         => 'int', size => 10 );

our @_varchar_45 = (
    data_type => 'varchar',
    size      => 45,
);

our @_varchar_100 = (
    data_type => 'varchar',
    size      => 100,
);

our @_varchar_255 = (
    data_type => 'varchar',
    size      => 255,
);

our @_datetime = (
    data_type => 'datetime',
    size      => 19,
);

our @_timestamp = ( data_type => 'timestamp', );

our @_float = (
    data_type => 'float',
    size      => 32,
);

our @_int_id = ( @_int, @_not_null, @_autoincrement, extra => {@_unsigned} );

our @_boolean = ( data_type => 'boolean', );

our @EXPORT = qw(
  @_unsigned
  @_int
  @_mediumint
  @_smallint
  @_not_null
  @_nullable
  @_autoincrement
  @_dont_cascade
  @_no_default
  @_int_10
  @_varchar_45
  @_varchar_100
  @_varchar_255
  @_datetime
  @_timestamp
  @_float
  @_int_id
  @_default_empty
  @_default_nodate
  @_boolean
);

1;

__END__

=pod

=head1 NAME

ReefStats::Schema::DataTypes;

=head1 DESCRIPTION

Pre-defined datatypes that can be used in the place or repetitive text in
DBIC definitions.

=cut
